<?php
/* SVN FILE: $Id: admin.ctp 2777 2010-08-17 05:52:29Z boopathi_026ac09 $ */
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.console.libs.templates.skel.views.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @version       $Revision: 7805 $
 * @modifiedby    $LastChangedBy: AD7six $
 * @lastmodified  $Date: 2008-10-30 23:00:26 +0530 (Thu, 30 Oct 2008) $
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(), "\n";?>
	<title><?php echo Configure::read('site.name');?> | <?php echo sprintf(__l('Admin - %s'), $this->Html->cText($title_for_layout, false)); ?></title>
	<?php
		echo $this->Html->meta('icon'), "\n";
		echo $this->Html->meta('keywords', $meta_for_layout['keywords']), "\n";
		echo $this->Html->meta('description', $meta_for_layout['description']), "\n";
		echo $this->Html->css('admin.cache', null, array('inline' => true));		
		echo $this->Javascript->link('default.cache', true);
		?>
	<!--[if IE 6]>
		<style>
		* {
			behavior: url(iepngfix.htc)
		}
		</style>
	<![endif]-->
</head>
<body class="admin">
  <?php if ($this->Session->check('Message.error') || $this->Session->check('Message.success') || $this->Session->check('Message.flash')): ?>
		<div class="js-flash-message flash-message-block">
			<?php
				if ($this->Session->check('Message.error')):
					echo $this->Session->flash('error');
				endif;
				if ($this->Session->check('Message.success')):
					echo $this->Session->flash('success');
				endif;
				if ($this->Session->check('Message.flash')):
					echo $this->Session->flash();
				endif;
			?>
		</div>
	<?php endif; ?>
	<div id="<?php echo $this->Html->getUniquePageId();?>" class="admin-content admin-content-block">
    <div class="admin-container-24">
    	<div id="header" class="clearfix">
	   
	 
		 <div class="clearfix">
	      <h1 class="grid_4 omega alpha">
		   <?php echo $this->Html->link((Configure::read('site.name').' '.'<span>Admin</span>'), array('controller' => 'users', 'action' => 'stats', 'admin' => true), array('escape' => false, 'title' => (Configure::read('site.name').' '.'Admin')));?>
    	 </h1>
	    	<ul class="admin-menu grid_right clearfix">
			        <li><?php echo $this->Html->link(__l('View Website'),  Router::url('/', true), array('title' => __l('View Site')));?></li>
					<?php 
					if($this->request->params['controller'] == 'users' && $this->request->params['action'] == 'admin_diagnostics') { $class = 'active'; } else { $class = ''; }?>
                    <li class="<?php echo $class; ?>"><?php echo $this->Html->link(__l('Diagnostics'), array('controller' => 'users', 'action' => 'diagnostics', 'admin' => true),array('title' => __l('Diagnostics'))); ?></li>
					<?php
					if($this->request->params['controller'] == 'pages' && $this->request->params['action'] == 'admin_display') { $class = 'active'; } else { $class = ''; }?>
                    <li class="<?php echo $class; ?>"><?php echo $this->Html->link(__l('Tools'), array('controller' => 'pages', 'action' => 'display', 'tools', 'admin' => true), array('title' => __l('Tools'))); ?></li>
					<?php 
					$class = ($this->request->params['controller'] == 'user_profiles' && $this->request->params['action'] == 'admin_user_account') ? ' class="active"' : null; ?>
                    <li <?php echo $class;?>><?php echo $this->Html->link(__l('My Account'), array('controller' => 'user_profiles', 'action' => 'user_account', $this->Auth->user('id')), array('title' => __l('My Account')));?></li>
					<li><?php echo $this->Html->link(__l('Logout'), array('controller' => 'users', 'action' => 'logout'), array('title' => __l('Logout')));?></li>
           </ul>
          </div>
              <?php echo $this->element('admin-sidebar', array('config' => 'sec')); ?>
    
              
             
            <div class="clearfix">
            	<p class="admin-welcome-info grid_10 omega alpha"><?php echo __l('Welcome, ').$this->Html->link($this->Auth->user('username'), array('controller' => 'users', 'action' => 'stats', 'admin' => true),array('title' => $this->Auth->user('username'))); ?></p>

			 <div class="grid_11 grid_right omage alpha admin-language-block">
                    <!--<?php echo $this->element('lanaguge-change-block');?>
    				<?php echo $this->element('admin-cities-filter');?>-->
				</div>
             </div>
          
 </div>
		<div id="main" class="clearfix">
		<?php if(($this->request->params['controller'] == 'users' && ($this->request->params['action'] == 'admin_stats'))){
                echo $content_for_layout;
				} else { ?>
       <div class="admin-side1-tl">
         <div class="admin-side1-tr">
         <div class="admin-side1-tm clearfix ">
         <h2 class="ribbon-title grid_left clearfix">
<?php
$diagnostics_menu = array('adaptive_transaction_logs');
if($this->request->params['controller'] == 'settings' && $this->request->params['action'] == 'index') {
	echo $this->Html->link(__l('Settings'), array('controller' => 'settings', 'action' => 'index'), array('title' => __l('Back to Settings'))); 				
}elseif($this->request->params['controller'] == 'settings' && $this->request->params['action'] == 'admin_edit' ) {
	echo $this->Html->link(__l('Settings'), array('controller' => 'settings', 'action' => 'index'), array('title' => __l('Back to Settings')));?> &raquo; <?php echo $setting_categories['SettingCategory']['name']; 
}elseif(in_array( $this->request->params['controller'], $diagnostics_menu) || $this->request->params['controller'] == 'users' && $this->request->params['action'] == 'admin_logs') { 
	echo $this->Html->link(__l('Diagnostics'), array('controller' => 'users', 'action' => 'diagnostics', 'admin' => true), array('title' => __l('Diagnostics')));?> &raquo; <?php echo $this->pageTitle;
}else {
	echo $this->pageTitle;
} ?>

		</h2>
	<?php	if($this->request->params['controller'] == 'settings') {
?>
<span class="setting-info info grid_right"><?php echo __l('To reflect setting changes, you need to') . ' ' . $this->Html->link(__l('clear cache'), array('controller' => 'devs', 'action' => 'clear_cache', '?f=' . $this->request->url), array('title' => __l('clear cache'), 'class' => 'js-delete'));  ?>.</span>
<?php }?>
		
        </div>
        </div>
        </div>
         <div class="admin-center-block">
    			<?php echo $content_for_layout;?>
		</div>
		  <div class="admin-side1-bl">
         <div class="admin-side1-br">
         <div class="admin-side1-bm">
            </div>
        </div>
        </div>
   	<?php } ?>

		</div>
	</div>
		<div id="footer" class="clearfix">
			<div class="footer-inner  container_24 clearfix">
				<div id="agriya" class="clearfix copywrite-info">
					<p>&copy;<?php echo date('Y');?> <?php echo $this->Html->link(Configure::read('site.name'), Router::Url('/',true), array('title' => Configure::read('site.name'), 'escape' => false));?>. <?php echo __l('All rights reserved');?>.</p>
				</div>
			</div>
		</div>
</div>

	<?php echo $this->element('site_tracker', array('config' => 'sec'));?>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>
